//
//  SelectAddressCell.swift
//  Box
//
//  Created by mn on 2025/4/1.
//

import UIKit
class SelectAddressCell: UITableViewCell {
    let addressView = AddressView()
    let arrowImageView = UIImageView(image: UIImage.arrowRightGray)
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI() {
        contentView.backgroundColor = .white
        contentView.addSubview(addressView)
        contentView.addSubview(arrowImageView)

        separatorInset = UIEdgeInsets(top: 0, left: 10000, bottom: 0, right: 0)
        arrowImageView.snp.makeConstraints { make in
            make.right.equalToSuperview().offset(-7.5)
            make.centerY.equalToSuperview()
        }
        addressView.snp.makeConstraints { make in
            make.left.top.bottom.equalToSuperview()
            make.right.equalTo(arrowImageView.snp.right).offset(-10)
        }
    }
    var data: AddressData!{
        didSet{
            addressView.data = data
        }
    }
}
